package com.acegear.horizon.controllers;

import java.util.List;
import java.util.Optional;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.acegear.horizon.controllers.vo.ResultVO;
import com.acegear.horizon.domain.events.ActivityCreateEvent;
import com.acegear.horizon.domain.models.Activity;
import com.acegear.horizon.domain.models.jpa.ActivityBase;
import com.acegear.horizon.domain.models.jpa.Address;
import com.acegear.horizon.domain.models.jpa.Location;
import com.acegear.horizon.domain.repository.jpa.ActivityBaseRepository;

@RestController
@RequestMapping("acitivity")
@Transactional
public class ActivityController {
	
	@Autowired
	private ActivityBaseRepository activityRepository;
	/**
	 * 保存活动基本信息
	 * 
	 */
	@RequestMapping( value = "/saveActivity" , method = RequestMethod.GET)
	public ResultVO saveAcitivity(String name,String servicePhone,String cover,String summary,String memo,boolean state,
    		Location location,Address address,
    		boolean deleted){
		Activity activity = new Activity();
		activity.saveActivity(name, servicePhone, cover, summary, memo, state, deleted);
		ActivityBase activityBase = new ActivityBase();
		activityBase.setName(name);
		return new ResultVO<>();
	}
	
	@RequestMapping(value = "/getActivityList" , method = RequestMethod.GET)
	public ResultVO getActivityList(String title){
		//List<Activity> activityList = activityRepository.findActivityListByTitle(title);
		return new ResultVO<>();
	}
	
	
	
}
